//
//  ST_DailyMomentCell.swift
//  btvideo
//
//  Created by mac on 2020/7/22.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit

class ST_DailyMomentCell: UITableViewCell {
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        
        contentView.backgroundColor = .white
        contentView.addSubview(itemView)
        itemView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate lazy var itemView:ST_DailyMomentItemView = {
       let control = ST_DailyMomentItemView()
        
        control.comment_click_closure = {[weak self] in
            
            guard let strongSelf = self else{
                return
            }
            
            strongSelf.comment_click_closure?(strongSelf)
        }
        
        return control
    }()
    
    
    var comment_click_closure:((ST_DailyMomentCell)->())?
    
    var reload_cell_closure:(()->())?{
        didSet{
            /*
            itemView.reload_cell_closure = {[weak self] in
                self?.reload_cell_closure?()
            }*/
            
            itemView.reload_cell_closure = self.reload_cell_closure
        }
    }
    
    weak var model:DailyMomentOfHallModel?{
        didSet{
            itemView.model = model
        }
    }
    
}
